﻿#region Using Directives

    using System;

    using Csla;

#endregion

namespace MarketPulse.Reporting.Core.Criteria
{
    /// <summary>
    /// Criteria class specifying a ClientGUID, ProfileGUID and ReportingPeriodGUID as search criteria.
    /// </summary>
    [Serializable]
    public class ClientGUIDAndBranchGUIDAndDateRangeCriteria : CriteriaBase<ClientGUIDAndBranchGUIDAndDateRangeCriteria>
    {

        #region Constructors

            /// <summary>
            /// Default constructor for this class
            /// </summary>
            /// <param name="clientGUID">The GUID of the Client to associate with this criteria</param>                
            /// <param name="branchGUID">The GUID of the Branch to associate with this criteria</param>                
            /// <param name="language">The language identifier (ie. en or fr) to use when localising text from the database.</param>
            /// <param name="startDateTime">The Start Date and Time (the point in time to start from) to associate with this criteria</param>   
            /// <param name="endDateTime">The End Date and Time (the point in time to work towards) to associate with this criteria</param>
            public ClientGUIDAndBranchGUIDAndDateRangeCriteria(Guid clientGUID, Guid branchGUID, string language, DateTime startDateTime, DateTime endDateTime)
            {
                ClientGUID = clientGUID;
                BranchGUID = branchGUID;
                Language = language;
                StartDateTime = startDateTime;
                EndDateTime = endDateTime;
            }

        #endregion

        #region Properties

            /// <summary>
            /// This GUID is used to identify the Client object associated with this criteria
            /// </summary>
            public static PropertyInfo<Nullable<Guid>> ClientGUIDProperty = RegisterProperty<Nullable<Guid>>(p => p.ClientGUID);
            /// <summary>
            /// This GUID is used to identify the Client object associated with this criteria
            /// </summary>
            public Nullable<Guid> ClientGUID
            {
                get { return ReadProperty(ClientGUIDProperty); }
                private set { LoadProperty(ClientGUIDProperty, value); }
            }

            /// <summary>
            /// The BranchGUID associated with this criteria object.
            /// </summary>
            public static PropertyInfo<Nullable<Guid>> BranchGUIDProperty = RegisterProperty<Nullable<Guid>>(p => p.BranchGUID);
            /// <summary>
            /// The BranchGUID associated with this criteria object.
            /// </summary>
            public Nullable<Guid> BranchGUID
            {
                get { return ReadProperty(BranchGUIDProperty); }
                private set { LoadProperty(BranchGUIDProperty, value); }
            }

            /// <summary>
            /// This is the language identifier (ie. en or fr) to use when localising text from the database.
            /// </summary>
            public static PropertyInfo<string> LanguageProperty = RegisterProperty<string>(p => p.Language);
            /// <summary>
            /// This is the language identifier (ie. en or fr) to use when localising text from the database.
            /// </summary>
            public string Language
            {
                get { return ReadProperty(LanguageProperty); }
                private set { LoadProperty(LanguageProperty, value); }
            }

            /// <summary>
            /// The StartDateTime associated with this criteria object.
            /// </summary>
            public static PropertyInfo<DateTime> StartDateTimeProperty = RegisterProperty<DateTime>(p => p.StartDateTime);
            /// <summary>
            /// The StartDateTime associated with this criteria object.
            /// </summary>
            public DateTime StartDateTime
            {
                get { return ReadProperty(StartDateTimeProperty); }
                private set { LoadProperty(StartDateTimeProperty, value); }
            }

            /// <summary>
            /// The EndDateTime associated with this criteria object.
            /// </summary>
            public static PropertyInfo<DateTime> EndDateTimeProperty = RegisterProperty<DateTime>(p => p.EndDateTime);
            /// <summary>
            /// The EndDateTime associated with this criteria object.
            /// </summary>
            public DateTime EndDateTime
            {
                get { return ReadProperty(EndDateTimeProperty); }
                private set { LoadProperty(EndDateTimeProperty, value); }
            }
      
        #endregion

    }
}
